namespace VAdvantage.Model
{

/** Generated Model - DO NOT CHANGE */
using System;
using System.Text;
using VAdvantage.DataBase;
using VAdvantage.Common;
using VAdvantage.Classes;
using VAdvantage.Process;
using VAdvantage.Model;
using VAdvantage.Utility;
using System.Data;
/** Generated Model for VSS_VW_BPSearch
 *  @author Jagmohan Bhatt (generated) 
 *  @version Vienna Framework 1.1.1 - $Id$ */
public class X_VSS_VW_BPSearch : PO
{
public X_VSS_VW_BPSearch (Context ctx, int VSS_VW_BPSearch_ID, String trxName) : base (ctx, VSS_VW_BPSearch_ID, trxName)
{
/** if (VSS_VW_BPSearch_ID == 0)
{
SetC_BPartner_ID (0);
SetIsCustomer (false);
SetIsVendor (false);
SetName (null);
SetVSS_VW_BPSearch_ID (0);
SetValue (null);
}
 */
}
public X_VSS_VW_BPSearch (Ctx ctx, int VSS_VW_BPSearch_ID, String trxName) : base (ctx, VSS_VW_BPSearch_ID, trxName)
{
/** if (VSS_VW_BPSearch_ID == 0)
{
SetC_BPartner_ID (0);
SetIsCustomer (false);
SetIsVendor (false);
SetName (null);
SetVSS_VW_BPSearch_ID (0);
SetValue (null);
}
 */
}
/** Load Constructor 
@param ctx context
@param rs result set 
@param trxName transaction
*/
public X_VSS_VW_BPSearch (Context ctx, DataRow rs, String trxName) : base(ctx, rs, trxName)
{
}
/** Load Constructor 
@param ctx context
@param rs result set 
@param trxName transaction
*/
public X_VSS_VW_BPSearch (Ctx ctx, DataRow rs, String trxName) : base(ctx, rs, trxName)
{
}
/** Load Constructor 
@param ctx context
@param rs result set 
@param trxName transaction
*/
public X_VSS_VW_BPSearch (Ctx ctx, IDataReader dr, String trxName) : base(ctx, dr, trxName)
{
}
/** Static Constructor 
 Set Table ID By Table Name
 added by ->Harwinder */
static X_VSS_VW_BPSearch()
{
 Table_ID = Get_Table_ID(Table_Name);
 model = new KeyNamePair(Table_ID,Table_Name);
}
/** Serial Version No */
static long serialVersionUID = 27563206083278L;
/** Last Updated Timestamp 8/6/2010 1:16:06 PM */
public static long updatedMS = 1281080766489L;
/** AD_Table_ID=1000112 */
public static int Table_ID;
 // =1000112;

/** TableName=VSS_VW_BPSearch */
public static String Table_Name="VSS_VW_BPSearch";

protected static KeyNamePair model;
protected Decimal accessLevel = new Decimal(3);
/** AccessLevel
@return 3 - Client - Org 
*/
protected override int Get_AccessLevel()
{
return Convert.ToInt32(accessLevel.ToString());
}
/** Load Meta Data
@param ctx context
@return PO Info
*/
protected override POInfo InitPO (Context ctx)
{
POInfo poi = POInfo.GetPOInfo (ctx, Table_ID);
return poi;
}
/** Load Meta Data
@param ctx context
@return PO Info
*/
protected override POInfo InitPO (Ctx ctx)
{
POInfo poi = POInfo.GetPOInfo (ctx, Table_ID);
return poi;
}
/** Info
@return info
*/
public override String ToString()
{
StringBuilder sb = new StringBuilder ("X_VSS_VW_BPSearch[").Append(Get_ID()).Append("]");
return sb.ToString();
}
/** Set Business Partner .
@param C_BPartner_ID Identifies a Business Partner */
public void SetC_BPartner_ID (int C_BPartner_ID)
{
if (C_BPartner_ID < 1) throw new ArgumentException ("C_BPartner_ID is mandatory.");
Set_ValueNoCheck ("C_BPartner_ID", C_BPartner_ID);
}
/** Get Business Partner .
@return Identifies a Business Partner */
public int GetC_BPartner_ID() 
{
Object ii = Get_Value("C_BPartner_ID");
if (ii == null) return 0;
return Convert.ToInt32(ii);
}
/** Set City.
@param City Identifies a City */
public void SetCity (String City)
{
if (City != null && City.Length > 60)
{
log.Warning("Length > 60 - truncated");
City = City.Substring(0,60);
}
Set_ValueNoCheck ("City", City);
}
/** Get City.
@return Identifies a City */
public String GetCity() 
{
return (String)Get_Value("City");
}
/** Set Customer.
@param IsCustomer Indicates if this Business Partner is a Customer */
public void SetIsCustomer (Boolean IsCustomer)
{
Set_ValueNoCheck ("IsCustomer", IsCustomer);
}
/** Get Customer.
@return Indicates if this Business Partner is a Customer */
public Boolean IsCustomer() 
{
Object oo = Get_Value("IsCustomer");
if (oo != null) 
{
 if (oo.GetType() == typeof(bool)) return Convert.ToBoolean(oo);
 return "Y".Equals(oo);
}
return false;
}
/** Set Vendor.
@param IsVendor Indicates if this Business Partner is a Vendor */
public void SetIsVendor (Boolean IsVendor)
{
Set_ValueNoCheck ("IsVendor", IsVendor);
}
/** Get Vendor.
@return Indicates if this Business Partner is a Vendor */
public Boolean IsVendor() 
{
Object oo = Get_Value("IsVendor");
if (oo != null) 
{
 if (oo.GetType() == typeof(bool)) return Convert.ToBoolean(oo);
 return "Y".Equals(oo);
}
return false;
}
/** Set Name.
@param Name Alphanumeric identifier of the entity */
public void SetName (String Name)
{
if (Name == null) throw new ArgumentException ("Name is mandatory.");
if (Name.Length > 120)
{
log.Warning("Length > 120 - truncated");
Name = Name.Substring(0,120);
}
Set_ValueNoCheck ("Name", Name);
}
/** Get Name.
@return Alphanumeric identifier of the entity */
public String GetName() 
{
return (String)Get_Value("Name");
}
/** Get Record ID/ColumnName
@return ID/ColumnName pair */
public KeyNamePair GetKeyNamePair() 
{
return new KeyNamePair(Get_ID(), GetName());
}
/** Set Phone.
@param Phone Identifies a telephone number */
public void SetPhone (String Phone)
{
if (Phone != null && Phone.Length > 40)
{
log.Warning("Length > 40 - truncated");
Phone = Phone.Substring(0,40);
}
Set_ValueNoCheck ("Phone", Phone);
}
/** Get Phone.
@return Identifies a telephone number */
public String GetPhone() 
{
return (String)Get_Value("Phone");
}
/** Set ZIP.
@param Postal Postal code */
public void SetPostal (String Postal)
{
if (Postal != null && Postal.Length > 10)
{
log.Warning("Length > 10 - truncated");
Postal = Postal.Substring(0,10);
}
Set_ValueNoCheck ("Postal", Postal);
}
/** Get ZIP.
@return Postal code */
public String GetPostal() 
{
return (String)Get_Value("Postal");
}
/** Set VSS_VW_BPSearch_ID.
@param VSS_VW_BPSearch_ID VSS_VW_BPSearch_ID */
public void SetVSS_VW_BPSearch_ID (int VSS_VW_BPSearch_ID)
{
if (VSS_VW_BPSearch_ID < 1) throw new ArgumentException ("VSS_VW_BPSearch_ID is mandatory.");
Set_ValueNoCheck ("VSS_VW_BPSearch_ID", VSS_VW_BPSearch_ID);
}
/** Get VSS_VW_BPSearch_ID.
@return VSS_VW_BPSearch_ID */
public int GetVSS_VW_BPSearch_ID() 
{
Object ii = Get_Value("VSS_VW_BPSearch_ID");
if (ii == null) return 0;
return Convert.ToInt32(ii);
}
/** Set Search Key.
@param Value Search key for the record in the format required - must be unique */
public void SetValue (String Value)
{
if (Value == null) throw new ArgumentException ("Value is mandatory.");
if (Value.Length > 40)
{
log.Warning("Length > 40 - truncated");
Value = Value.Substring(0,40);
}
Set_ValueNoCheck ("Value", Value);
}
/** Get Search Key.
@return Search key for the record in the format required - must be unique */
public String GetValue() 
{
return (String)Get_Value("Value");
}
}

}
